package com.pdsu.graduation_design.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.pdsu.graduation_design.R;
import com.pdsu.graduation_design.domain.Type;

import java.util.List;

public class MyCommodityUpSpinnerAdapter_Type extends BaseAdapter {
    private Context context;
    private List<Type> types;

    public MyCommodityUpSpinnerAdapter_Type(Context context, List<Type> types) {
        this.context = context;
        this.types = types;
    }

    @Override
    public int getCount() {
        return types.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view=View.inflate(context, R.layout.my_commodity_up_type_item,null);
        TextView typeName= view.findViewById(R.id.type_item_tv);
        typeName.setText(types.get(position).getTypename());
        return view;
    }
}
